package com.ywy.job.enums;

/**
 * 任务状态枚举
 */
public enum JobStatusEnum {
    STOP(0, "停止"),
    RUNNING(1, "运行");

    private Integer code;
    private String value;

    JobStatusEnum(Integer code, String value) {
        this.value = value;
        this.code = code;
    }

    public static JobStatusEnum getEnumByKey(Integer key) {
        for (JobStatusEnum e : JobStatusEnum.values()) {
            if (e.getCode() == key) {
                return e;
            }
        }
        return null;
    }

    /** 获取value */
    public String getValue() {
        return value;
    }

    /** 获取code */
    public Integer getCode() {
        return code;
    }
}
